//
//  DDInvoiceDetailHeadTitle.swift
//  DingDongZP
//
//  Created by 三秒文化 on 2016/10/18.
//  Copyright © 2016年 51ledian.com. All rights reserved.
//

import UIKit

class DDInvoiceDetailHeadTitle: LDBaseView {


    var titleLab:UILabel?
    
    var showStatus = true {
        
        didSet{
            
            selStatusLab?.hidden = showStatus
        }
    }
    
    var titleDescLab:UILabel?
    var imageView:UIImageView?

    
    var selStatusLab:UILabel?
    private var bottomLine = {return UIView()}()
    
    override init(frame: CGRect) {
        super.init(frame: frame)
        
        titleLab = UILabel.setBaseLab("开票信息", fontSize: 16, titleColor: LDFontColor.Black, Alignment: .Left)
        imageView =  UIImageView(image: UIImage(named:"common_cell_arrow"))
        
        selStatusLab = UILabel.setBaseLab("(默认开票信息)", fontSize: 13, titleColor: LDFontColor.Orange, Alignment: .Left)
        selStatusLab?.hidden = showStatus
        
        
        bottomLine.backgroundColor = LDLineColorLightGray
        
        addSubview(titleLab!)
        addSubview(selStatusLab!)
        addSubview(imageView!)
        addSubview(bottomLine)
        
        titleLab?.snp_makeConstraints(closure: { (make) in
            
            make.centerY.equalTo(self)
            make.left.equalTo(leftMargin)
            make.height.equalTo(35)
            
        })
        
        imageView?.snp_makeConstraints { (make) in
            
            make.centerY.equalTo(self)
            make.right.equalTo(-LDMargin_V*2)
            make.size.equalTo(CGSizeMake(10, 15))
        }
        
        selStatusLab?.snp_makeConstraints(closure: { (make) in
            
            make.centerY.equalTo(titleLab!)
            make.left.equalTo(titleLab!.snp_right).offset(LDMargin_H*2)
            make.height.equalTo(15)
//            make.width.equalTo(100)

        })
        
        
        
        
        bottomLine.snp_makeConstraints { (make) in
            
            make.left.right.bottom.equalTo(0)
            make.height.equalTo(0.8)
        }
        
    }
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }

}
